#ifndef NET_H
#define NET_H
class TPacket{
 public:
  char* data;
  long length;
  long send_time;
  TPacket(char* data, int length);
};

class TSocket{
 public:
  TSocket(std::string server_ip, int server_port, int local_port);
  void send_packet(TPacket);
  TPacket recv_packet();
};

class TGameSocket{
 public:
  TSocket Socket;
  TActionList* get_actions();
  void send_actions(TActionList* actions);
  int server_state();
  bool operator<<(TActionList& actions); //send actions to the server
  bool operator>>(TActionList& actions); //get actions from server and merge them with local ones
  TGameSocket();
};

#endif
